package com.caiyouxi.system.controller;

import com.caiyouxi.boss.buser.model.SysUserProfileBean;
import com.caiyouxi.system.service.SysSetingService;
import com.caiyouxi.common.bean.ResData;
import com.caiyouxi.common.control.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/boss/system")
public class SystemController extends BaseController{

    @Autowired
    SysSetingService sysSetingService;

    /**
     * 登陆是否需要验证码
     */
    @RequestMapping("/is_aptcha")
    public ResData is_aptcha(HttpServletRequest request, HttpServletResponse response, @RequestBody SysUserProfileBean bean){

        return sysSetingService.select_is_aptcha(bean);
    }

    @RequestMapping("/redis")
    public ResData get_redis(){
        String key = "sdfe";
        String value = (String) sysSetingService.get_setting_value(key);
        System.out.println(value);
        return success(value);
    }

}
